home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10742 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  811 b 

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Q about the float point format......
  5. Date: 19 Mar 1996 09:57:18 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4imshuINNs22@keats.ugrad.cs.ubc.ca>
  8. References: <s3032089.15.314E68DD@sparc13.ncu.edu.tw> <4imhl7$jcf@news.xs4all.nl>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4imhl7$jcf@news.xs4all.nl>, Falstaff <falstaff@xs4all.nl> wrote:
  12.  >s3032089@sparc13.ncu.edu.tw (Alexander PeaceLand) writes:
  13.  >
  14.  >
  15.  >>   Could I dynamicly set the digits after the float POINT?
  16.  
  17. [snip]
  18.  
  19.  >   i=3;  /* or whatever */
  20.  >   printf("%.*f",123.456789,i);
  21.  >
  22.  >That should work.
  23.  
  24. I believe that the i must come before the floating argument.
  25. -- 
  26.  
  27.